n,m,k = input().split()
k = float(k)
mp = {}
for i in range(int(n)):
    name,ex = input().split()
    ex = int(ex)
    ex*=k
    if ex>=100:
        mp[name] = ex
for i in range(int(m)):
    name = input()
    if name not in mp:
        mp[name] = 0
print(len(mp))
for key in sorted(mp.keys()):
    print(key,"%d"%mp[key])
input()
